package level4project.v4modify_decorator.view;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JPanel;

public class LightView extends JPanel implements Observer {
	private boolean on = false;
	protected void paintComponent(Graphics g) { 		
		super.paintComponent(g);
		if(on) {
			g.setColor(Color.YELLOW);
		}else {
			g.setColor(Color.GRAY);
		}
		g.fillOval(5, 5, 30, 30);
	}

	@Override
	public void update(boolean on) {
		this.on = on;
		this.repaint();
	}

}
